package com.ugoodtech.mdcc.web.dto;


import com.ugoodtech.mdcc.core.QuestionConstants;
import com.ugoodtech.mdcc.core.StatusConstants;
import com.ugoodtech.mdcc.core.domain.Question;
import com.ugoodtech.mdcc.core.utils.StatusUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Copyright © 2013 All Rights Reserved, Ugood Technology, Inc.
 */
@ApiModel("题目数据")
public class QuestionResponse {
    @ApiModelProperty("编号")
    private Long questionId;
    @ApiModelProperty("标题")
    private String title;
    @ApiModelProperty("类型")
    private String type;
    @ApiModelProperty("内容")
    private String content;
    @ApiModelProperty("是否必填")
    private String required;
    @ApiModelProperty("状态")
    private String status;



    public QuestionResponse(Question question) {
        this.questionId=question.getId();
        this.title=question.getSubject();
        this.type= StatusUtil.getStatusStr(question.getCategory().name(), QuestionConstants.QUESTION_LIST);
        this.content=question.getSubject();
        this.required=StatusUtil.getStatusStr(question.isRequired(), StatusConstants.Q_REQUIRED,StatusConstants.Q_UN_REQUIRED);
        this.status=StatusUtil.getStatusStr(question.isEnabled(), StatusConstants.Q_USING,StatusConstants.Q_DISABLE);
    }

    public Long getQuestionId() {
        return questionId;
    }

    public void setQuestionId(Long questionId) {
        this.questionId = questionId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getRequired() {
        return required;
    }

    public void setRequired(String required) {
        this.required = required;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

}
